﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace linkouqs.Gamekit {

    public sealed class CharacterDrawRaycast : MonoBehaviour {

#if UNITY_EDITOR

        public bool drawGizmos = true;

        void OnDrawGizmos() {

            if (!drawGizmos) {
                return;
            }

            CharacterController2D controller2D = GetComponent<CharacterController2D>();
            if (controller2D != null) {

                BoxCollider2D boxCollider2D = GetComponent<BoxCollider2D>();
                if (boxCollider2D != null) {
                    boxCollider2D.DrawRaycast(controller2D.raycastDistance, controller2D.raycastCount);
                }
            }
        }

#endif
    }
}

